<div id="header">

    <?
        $accommodation=$reservations=$partners=$options="";
        switch($this->router->fetch_class())
        {
            case 'objects':
            case 'objects_prices':
            case 'price_schedules':
            case 'rooms_info':
            case 'rooms_gallery':
            case 'objects_description':
            case 'objects_info':
            case 'objects_gallery':
            case 'objects_cancellation':
            case 'objects_category':
            case 'destinations':
            case 'destinations_gallery':
            case 'units':
            case 'objects_extra_bed':
            case 'discounts':
                $accommodation="current";
                break;
            case 'reservations':
                $reservations="current";
                break;
            case 'partners':
                $partners="current";
                break;
            case 'attributes':
            case 'objects_groups':
            case 'user_account':
            case 'profiles':
            case 'maillist':
                $options="current";
                break;
        }
    ?>
    <style>
        #time_date{
            position: absolute;
            top: 7px;
            right: 213px;
            color: #FFBCBB;
            text-shadow: 0 1px 2px #670303;
        }
    </style>
    <div class="header-bar clearfix">

        <div id="time_date">
            <p><?= date('l, d M Y', time()) ?></p>
        </div>

        <div class="right clearfix">
            <a id="brand" href="http://www.ibookhotel.me" target="_blank">iBookHotel</a>

            <ul class="nav right">
                <?
                    if($this->session->userdata('ac_type') == "agency")
                    {
                        ?>

                        <li><a href="<?= base_url() ?>user_manual/iBookHotelUserManual.pdf" target="_blank"><i class="icon-help"></i> User Manual</a></li>

                        <?
                    }
                    elseif($this->session->userdata('ac_type') == "hotel")
                    {
                        ?>

                        <li><a href="<?= base_url() ?>user_manual/iBookHotelUserManual_hotel.pdf" target="_blank"><i class="icon-help"></i> User Manual</a></li>

                    <? } ?>


                <li><!-- just here for borders --></li>
            </ul>
        </div>

        <ul class="sf-menu nav clearfix">

            <?
                if($this->session->userdata('ac_type') == "agency")
                {
                    ?>

                    <li class="home"><a href="<?= base_url() ?>" class="home_ico"><img src="<?= base_url() ?>/assets/img/header/house.png"></a></li>

                    <?
                }
                elseif($this->session->userdata('ac_type') == "hotel")
                {
                    ?>

                    <li class="home"><a href="<?= base_url('objects_prices/view/'.$this->session->userdata('objects_ID')) ?>" class="home_ico"><img src="<?= base_url() ?>/assets/img/header/house.png"></a></li>

                <? } ?>



            <li class="dropdown <?= $reservations ?>">

                <a href="<?= base_url('reservations/view_all') ?>"><b class="caret"></b> Reservations</a>

                <ul class="dropdown-menu">
                    <? if($this->session->userdata('ac_type') == "agency"): ?>
                            <li><a href="<?= base_url('guarantee/view_all') ?>">Guarantee</a></li>
                            <li class="divider"></li>
                        <? endif; ?>
                    <li><a href="<?= base_url('reservations/view_all') ?>">Reservations</a></li>
                    <? if($this->session->userdata('ac_type') == "agency"): ?>
                            <li><a href="<?= base_url('reservations/view_new') ?>">New reservation</a></li>
                        <? endif; ?>

                </ul>

            </li>

            <? if($this->session->userdata('ac_type') == "agency"): ?>

                    <li class="dropdown <?= $accommodation ?>">

                        <a href="<?= base_url('objects/view_all') ?>"><b class="caret"></b> Accommodation</a>

                        <ul class="dropdown-menu">

                            <li><a href="<?= base_url('destinations/view_all') ?>">Destination view</a></li>
                            <li class="divider"></li>
                            <li><a href="<?= base_url('objects/view_all') ?>">Accommodation</a></li>
                            <li><a href="<?= base_url('objects/view_new_general') ?>">New object</a></li>

                        </ul>

                    </li>

                    <li class="dropdown <?= $partners ?>">

                        <a href="<?= base_url('partners/view_all') ?>"><b class="caret"></b> Partners</a>

                        <ul class="dropdown-menu">

                            <li><a href="<?= base_url('partners/view_all') ?>">Partners</a></li>
                            <li><a href="<?= base_url('partners/view_new') ?>">New Partner</a></li>

                        </ul>

                    </li>
                <? endif; ?>
            <li class="dropdown <?= $options ?>">

                <a href="javascript:"><b class="caret"></b> Options</a>

                <ul class="dropdown-menu">

                    <? if($this->session->userdata('ac_type') == "agency"): ?>
                            <li><a href="<?= base_url('maillist/view_all') ?>">Mail list</a></li>
                            <li class="divider"></li>
                            <li><a href="<?= base_url('profiles/view_all') ?>">Hotels profiles</a></li>
                            <li class="divider"></li>
                            <li><a href="<?= base_url('attributes/view_all') ?>">Attributes</a></li>
                            <li><a href="<?= base_url('objects_groups/view_all') ?>">Groups</a></li>

                        <? endif; ?>

                    <li><a href="<?= base_url('user_account') ?>">User Account</a></li>

                </ul>

            </li>



            <li><a href="<?= WEB_SITE ?>" target="_blank">Go to website</a></li>
            <li><a href="<?= base_url('login/logout') ?>">Logout</a></li>
            <li><!-- just here for borders --></li>

        </ul>

    </div>
</div>